 
package com.xbongbong.pro.statistic.model.impl;

import com.xbongbong.paas.toolbox.util.DateUtil;
import com.xbongbong.pro.domain.dao.ChartFavoriteDao;
import com.xbongbong.pro.domain.entity.ChartFavoriteEntity;
import com.xbongbong.pro.statistic.model.ChartFavoriteModel;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


/**
* @author autoGen
* @time 2019-01-07 11:13:40
*/
@Service("chartFavoriteModel")
public class ChartFavoriteModelImpl implements ChartFavoriteModel {

	@Resource
	private ChartFavoriteDao dao;
	@Override
	public Integer insert(ChartFavoriteEntity entity){
		long now = DateUtil.getInt();
    	((ChartFavoriteEntity)entity).setAddTime(now);
    	((ChartFavoriteEntity)entity).setUpdateTime(now);
		
		return dao.insert((ChartFavoriteEntity)entity);
	}
	@Override
	public Integer update(ChartFavoriteEntity entity){
		((ChartFavoriteEntity)entity).setUpdateTime((long) DateUtil.getInt());
		
		return dao.update((ChartFavoriteEntity)entity);
	}

	@Override
	public Integer save(ChartFavoriteEntity entity){
		if(entity.getId() == null || entity.getId().equals(0L)) {
			return insert(entity);
		}
		return update(entity);
	}

	@Override
	public void insertBatch(List<ChartFavoriteEntity> entityList) {
    	dao.insertBatch(entityList);
    }

    @Override
	public void updateBatch(List<ChartFavoriteEntity> entityList) {
    	dao.updateBatch(entityList);
    }
	@Override
	public Integer deleteByKey( Long key,  String corpid){
		return dao.deleteByKey(key , corpid);
	}
	@Override
	public ChartFavoriteEntity getByKey( Long key,  String corpid){
		return dao.getByKey(key , corpid);
	}

	@Override
	public List<ChartFavoriteEntity> findEntitys(Map<String ,Object>  param){
		return dao.findEntitys(param);
	}
    @Override
	public Integer getEntitysCount(Map<String ,Object>  param){
		return dao.getEntitysCount(param);
	}

    @Override
    public List findEntitysWithoutSub(Map<String, Object> param) {
        return null;
    }


}

 